home *** CD-ROM | disk | FTP | other *** search
- <XST Filename='pilotdump.xst'
- Description='Output entire address database from Pilot database to HTML or Plaintext'
- Author='David Ball/Philip Allen'
- Version='2.0'
- Date='8 April 1999'
- Copyright='© 1999 DecisionSoft Limited'
- XMLscript='1.0'
- Ref='pilotdump'
- debug=''
- __maxCR="2"
- ><_if test=" \ENV\REQUEST_METHOD.__exists" >Content-type: text/html
-
- </_if>
-
- <!--
- We need the "Content-type: text/html" to be on the first output line
- followed by two carriage returns, if we're running in cgi
-
- Note the 'double backslash' used instead of the single backslash. Always
- use double backslash when describing DOS/Windows directory paths.
- -->
-
- <!--
- YOU NEED TO CONFIGURE THESE
- -->
- # $\.appsRoot := "..\\pilot\\" #
- # $\.datName := "sample.dat" #
-
-
- <_if test=" \ENV\REQUEST_METHOD.__exists" >
- <then> # $\.context := "cgi" # </then>
- <else> # $\.context := "cmdline" # </else>
- </_if>
-
- <_if>
- # $\.fileOut := "1" !! Set context to cgi for this !! #
- # $\.context := "cgi" #
- </_if>
-
- <!--
- Set global attributes
- -->
-
- # $.cellColor := "yellow" #
- # $.mainColor := "lightblue" #
-
- <!--
- Define the system command
- -->
-
- # $\.cmd := $\.appsRoot 'loadbook ' $\.appsRoot $\.datName #
- # $\.sysCmd := $\.cmd '> c:\\temp\\CGItmp.txt' #
-
- <!--
- The system command is piped to file to make it work with httpd.
- -->
-
- <_eval result="data">
- <_filter find='\#' replace='' >
- <Pilot>
- <_system command="# $\.sysCmd #"/>
- <_echo file="c:\temp\CGItmp.txt" />
- </Pilot>
- </_filter>
- </_eval>
-
- <_if>
- Debug information: incoming data -# \Pilot #-
- </_if>
-
- <!--
- Define the template we're going to run
- -->
-
- <_template name="DisplayHTML">
- <HTML>
- <HEAD>
- <TITLE>XML address display</TITLE>
- </HEAD>
- <BODY BGCOLOR="ffffff">
- <CENTER>
- <TABLE CELLPADDING="10" CELLSPACING="0">
- <TR>
- <TD ALIGN="left" VALIGN="top" COLSPAN="5">
- <IMG SRC="images/xmlscript.jpg" ALT="XML Script" />
- </TD>
- </TR>
- <TR BGCOLOR="#$.mainColor#">
- <TD><STRONG>ID</STRONG></TD>
- <TD><STRONG>Status</STRONG></TD>
- <TD><STRONG>Position</STRONG></TD>
- <TD><STRONG>Name</STRONG></TD>
- <TD><STRONG>Title</STRONG></TD>
- <TD><STRONG>Company</STRONG></TD>
- <TD><STRONG>Address</STRONG></TD>
- <TD><STRONG>Email</STRONG></TD>
- <TD><STRONG>Work</STRONG></TD>
- <TD><STRONG>Home</STRONG></TD>
- <TD><STRONG>Fax</STRONG></TD>
- <TD><STRONG>Pager</STRONG></TD>
- <TD><STRONG>Note</STRONG></TD>
- <TD><STRONG>Private</STRONG></TD>
- <TD><STRONG>Category</STRONG></TD>
- <TD><STRONG>DisplayPhone</STRONG></TD>
- <TD><STRONG>c1</STRONG></TD>
- <TD><STRONG>c2_w0__</STRONG></TD>
- <TD><STRONG>c3</STRONG></TD>
- <TD><STRONG>c4</STRONG></TD>
- </TR>
-
- <_foreach object="AddressRecord">
- <TR BGCOLOR="#$.mainColor#">
- <TD BGCOLOR="#$.cellColor#">#.ID#<_if test="not(.ID)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#.Status#</TD>
- <TD BGCOLOR="#$.cellColor#">#.Position#<_if test="not(.Position)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#FirstName# #LastName#<_if test="not(FirstName) and not(LastName)">None
- </_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Title#<_if test="not(Title)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Company#<_if test="not(Company)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Address# #City# #State# #ZipCode# #Country#<_if test="not(Address) and
- not(City) and not(State) and not(ZipCode) and not(Country)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#"><A HREF="#'mailto:' Email#">#Email#</A><_if test="not(Email)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Phone#<_if test="not(Phone)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Home#<_if test="not(Home)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Fax#<_if test="not(Fax)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Pager#<_if test="not(Pager)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Note#<_if test="not(Note)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#Private#</TD>
- <TD BGCOLOR="#$.cellColor#">#Category#<_if test="not(Category)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#DisplayPhone#<_if test="not(DisplayPhone)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#c1#<_if test="not(c1)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#c2_w0__#<_if test="not(c2_w0__)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#c3#<_if test="not(c3)">None</_if></TD>
- <TD BGCOLOR="#$.cellColor#">#c4#<_if test="not(c4)">None</_if></TD>
- </TR>
- </_foreach>
- </TABLE>
- </CENTER>
- </BODY>
- </HTML>
- </_template>
-
- <_template name="DisplayPlain">
-
- XML Contact Display
-
- <_foreach object="AddressRecord">
- -----------------------------------------
- <_if test=".ID">ID: #.ID#
- </_if>Status: #.Status#
- <_if test=".Position">Position: #.Position#
- </_if><_if test="(FirstName) or (LastName)">Name: #FirstName# #LastName#
- </_if><_if test="Title">Title: #Title#
- </_if><_if test="Company">Company: #Company#
- </_if><_if test="(Address) or (City) or (State) or (ZipCode) or (Country)">Address: #Address# #City# #State# #ZipCode# #Country#
- </_if><_if test="Email">Email: #Email#
- </_if><_if test="Phone">Work: #Phone#
- </_if><_if test="Home">Home: #Home#
- </_if><_if test="Fax">Fax: #Fax#
- </_if><_if test="Pager">Pager: #Pager#
- </_if><_if test="Note">Note: #Note#
- </_if>Private: #Private#
- <_if test="Category">Category: #Category#
- </_if><_if test="DisplayPhone">DisplayPhone: #DisplayPhone#
- </_if><_if test="c1">c1: #c1#
- </_if><_if test="c2_w0__">c2_w0__: #c2_w0__#
- </_if><_if test="c3">c3: #c3#
- </_if><_if test="c4">c4: #c4#
- </_if></_foreach>
-
- </_template>
-
- <!--
- Tie the template to the data
- -->
-
- <_method object="Pilot" template="DisplayHTML" context="cgi" />
- <_method object="Pilot" template="DisplayPlain" context="cmdline" />
-
- <!--
- Process the data
- -->
-
- <_process object="\Pilot" />
-
- </XST>
-